package com.dz.core.dto;

/**
 * request 参数实体
 * Created by Tech on 2015/9/7.
 */
public class ReqBody<T> {
    private String sign; //签名
    private String appId; //appId
    private Integer rnd; //随机数
    private Long timestamp; //时间戳
    private Page page; //分页
    private T body; //业务主体

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public Integer getRnd() {
        return rnd;
    }

    public void setRnd(Integer rnd) {
        this.rnd = rnd;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public Page getPage() {
        return page;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }


//    public <T> T getBody(Class clazz) throws RuntimeException {
//        return  (T)JSONObject.toJavaObject(body,clazz);
//    }

    @Override
    public String toString() {
//        String temppage = (Assert.isNotNull(page))? JSONObject.toJSONString(page):"";
//        String tempbody = (Assert.isNotNull(body))? JSONObject.toJSONString(body):"";

        return "ReqBody{" +
                "sign='" + sign + '\'' +
                ", appId='" + appId + '\'' +
                ", rnd=" + rnd +
                ", timestamp=" + timestamp +
//                ", page=" + temppage +
//                ", body=" + tempbody +
                '}';
    }
}
